import axio from '../assets/axio.js'

export const cmpt_header = {
  template: `
  <header id="main_header">
    <section>
      <img class="icon" src="/assets/Masquerade.ico" alt="" />
        <span class="text"></span>
        <div class="nav">
          <span class="nav-item" :class="page==0?'active':''" @click="$emit('submit-page',0)" >下载</span>
          <span class="nav-item" :class="page==1?'active':''" @click="$emit('submit-page',1)">上传</span>
          <span class="nav-item" :class="page==2?'active':''" @click="$emit('submit-page',2)">文本</span>
          <!-- <span class="nav-item" @click="debug_clear">清空文件夹</span> -->
        </div>
    </section>
    <section>
      <div class="nav">
        <span class="nav-item" :class="page==9?'active':''" @click="$emit('submit-page',9)">关于</span>
      </div>
    </section>
  </header>
  <hr style="border:none;margin:1.5rem 0">
    `,
  name: "compt_header",
  props: {
    page: { type: Number, default: 0 },
  },
  emits: ['submit-page'],
  methods: {
    handleSubmitPage(value) {
      this.$emit('submit-page',)
    },
    debug_clear() {
      axio.get("/fields/clearupload")
        .then((response) => {
          console.log(response);
        })
    }
  }
};

